home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / ogrid100.zip / TCUTIL.INT < prev    next >
Text File  |  1994-12-29  |  2KB  |  118 lines

  1.  
  2. { Copyright (c) 1989,90 by Borland International, Inc. }
  3.  
  4. unit TCUtil;
  5. { Turbo Pascal 6.0 object-oriented example miscellaneous utility routines.
  6.   This unit is used by TCALC.PAS.
  7.   See TCALC.DOC for an more information about this example.
  8. }
  9.  
  10. {$S-}
  11.  
  12. interface
  13.  
  14. uses Crt, Dos;
  15.  
  16. const
  17.   FreeListItems = 100;      { Sets the size of the free list }
  18.   Letters : set of Char = ['A'..'Z', 'a'..'z'];
  19.   Numbers : set of Char = ['0'..'9'];
  20.   ErrAbstractCall = 'Call to abstract method ';
  21.   ErrNoMemory = 'Out of memory';
  22.   NULL = 0;
  23.   BS = 8;
  24.   FF = 12;
  25.   CR = 13;
  26.   ESC = 27;
  27.   F1 = 15104;
  28.   F2 = 15360;
  29.   F3 = 15616;
  30.   F4 = 15872;
  31.   F5 = 16128;
  32.   F6 = 16384;
  33.   F7 = 16640;
  34.   F8 = 16896;
  35.   F9 = 17152;
  36.   F10 = 17408;
  37.   AltF1 = 26624;
  38.   AltF2 = 26880;
  39.   AltF3 = 27136;
  40.   AltF4 = 27392;
  41.   AltF5 = 27648;
  42.   AltF6 = 27904;
  43.   AltF7 = 28160;
  44.   AltF8 = 28416;
  45.   AltF9 = 28672;
  46.   AltF10 = 28928;
  47.   HomeKey = 18176;
  48.   UpKey = 18432;
  49.   PgUpKey = 18688;
  50.   LeftKey = 19200;
  51.   RightKey = 19712;
  52.   EndKey = 20224;
  53.   DownKey = 20480;
  54.   PgDnKey = 20736;
  55.   InsKey = 20992;
  56.   DelKey = 21248;
  57.   CtrlLeftKey = 29440;
  58.   CtrlRightKey = 29696;
  59.   AltX = 11520;
  60.  
  61. type
  62.   ProcPtr = procedure;
  63.   StringPtr = ^String;
  64.   WordPtr = ^Word;
  65.   CharSet = set of Char;
  66.  
  67. procedure Abstract(Name : String);
  68.  
  69. function Compare(var P1, P2; Length : Word) : Boolean;
  70.  
  71. function GetKey : Word;
  72.  
  73. function GetKeyUpCase : Word;
  74.  
  75. function GetKeyChar(Legal : CharSet) : Char;
  76.  
  77. procedure Abort(Message : String);
  78.  
  79. procedure Beep;
  80.  
  81. function FileExists(F : String) : Boolean;
  82.  
  83. function Min(N1, N2 : Longint) : Longint;
  84.  
  85. function Max(N1, N2 : Longint) : Longint;
  86.  
  87. function NumToString(N : Longint) : String;
  88.  
  89. function UpperCase(S : String) : String;
  90.  
  91. function FillString(Len : Byte; Ch : Char) : String;
  92.  
  93. function TruncStr(TString : String; Len : Byte) : String;
  94.  
  95. function PadChar(PString : String; Ch : Char; Len : Byte) : String;
  96.  
  97. function CenterStr(S : String; Width : Byte) : String;
  98.  
  99. function LeftJustStr(S : String; Width : Byte) : String;
  100.  
  101. function RightJustStr(S : String; Width : Byte) : String;
  102.  
  103. function ColToString(Col : Word) : String;
  104.  
  105. function RowToString(Row : Word) : String;
  106.  
  107. function StringToCol(S : String; MaxCols : Word) : Word;
  108.  
  109. function StringToRow(S : String; MaxRows : Word) : Word;
  110.  
  111. procedure ClearInputBuffer;
  112.  
  113. implementation
  114.  
  115. ...
  116.  
  117. end.
  118.